Skip to content

fix(rivetkit-core): abort graceful cleanup task when grace deadline elapses#4745

Merged
NathanFlurry merged 1 commit intomainfrom
sleep-cleanup/04-abort-graceful-cleanup-at-deadline
Apr 27, 2026
Merged

fix(rivetkit-core): abort graceful cleanup task when grace deadline elapses#4745
NathanFlurry merged 1 commit intomainfrom
sleep-cleanup/04-abort-graceful-cleanup-at-deadline

Conversation

@NathanFlurry
Copy link
Copy Markdown
Member

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link
Copy Markdown
Member Author

NathanFlurry commented Apr 24, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@claude
Copy link
Copy Markdown

claude Bot commented Apr 24, 2026

Review: fix(rivetkit-core): abort graceful cleanup task when grace deadline elapses

Small, focused fix adds a shutdown_deadline cancellation token so NAPI adapter cleanup work can be raced against the grace period deadline.

Correctness

  • Both shutdown paths covered.
  • Ordering is correct.
  • tokio::select! correctly drops the work future.
  • reply.send(Ok(())) is unconditional.

Naming nit

cancel_shutdown_deadline reads as cancel/prevent the deadline rather than fire/trigger it.

Test coverage

No tests added. A test for the slow-callback-abandoned-at-deadline path would strengthen confidence.


Overall the approach is clean and correct. No blocking issues.

@NathanFlurry NathanFlurry force-pushed the sleep-cleanup/03-sleep-destroy-guards branch from a8c2068 to 7be35f1 Compare April 24, 2026 11:48
@NathanFlurry NathanFlurry force-pushed the sleep-cleanup/04-abort-graceful-cleanup-at-deadline branch from 2b7d922 to 04fb3f4 Compare April 24, 2026 11:48
@NathanFlurry NathanFlurry force-pushed the sleep-cleanup/03-sleep-destroy-guards branch from 7be35f1 to 734fc88 Compare April 24, 2026 12:14
@NathanFlurry NathanFlurry force-pushed the sleep-cleanup/04-abort-graceful-cleanup-at-deadline branch from 04fb3f4 to 645f8a4 Compare April 24, 2026 12:14
@NathanFlurry NathanFlurry force-pushed the sleep-cleanup/03-sleep-destroy-guards branch from 734fc88 to efecd06 Compare April 24, 2026 12:32
@NathanFlurry NathanFlurry force-pushed the sleep-cleanup/04-abort-graceful-cleanup-at-deadline branch from 645f8a4 to 77297b3 Compare April 24, 2026 12:32
@NathanFlurry NathanFlurry force-pushed the sleep-cleanup/04-abort-graceful-cleanup-at-deadline branch from 77297b3 to ee89168 Compare April 24, 2026 13:16
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 24, 2026

Preview packages published to npm

Install with:

npm install rivetkit@pr-4745

All packages published as 0.0.0-pr.4745.dd74d75 with tag pr-4745.

Engine binary is shipped via @rivetkit/engine-cli on linux-x64-musl, linux-arm64-musl, darwin-x64, and darwin-arm64. Windows users should use the release installer or set RIVET_ENGINE_BINARY.

Docker images:

docker pull rivetdev/engine:slim-dd74d75
docker pull rivetdev/engine:full-dd74d75
Individual packages
npm install rivetkit@pr-4745
npm install @rivetkit/react@pr-4745
npm install @rivetkit/rivetkit-napi@pr-4745
npm install @rivetkit/workflow-engine@pr-4745

Base automatically changed from sleep-cleanup/03-sleep-destroy-guards to main April 27, 2026 07:13
@NathanFlurry NathanFlurry merged commit 603e7e2 into main Apr 27, 2026
38 of 52 checks passed
@NathanFlurry NathanFlurry deleted the sleep-cleanup/04-abort-graceful-cleanup-at-deadline branch April 27, 2026 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant